package com.hmall.common.web;


import com.hmall.common.dto.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@FeignClient("itemservice")
@Component
public interface ExampleClient {

    /**
     * 功能描述: 根据id查询商品
     * @return :
     * @param id
     */
    @GetMapping("/item/{id}")
    public Item selectById(@PathVariable Long id);
    /**
     * 功能描述: 扣减库存
     * @return :
     * @param id
     * @param num
     */
    @PutMapping("/item/stock")
    public String stockMinus(@RequestParam("id")Long id,@RequestParam("num")Long num);

    @PutMapping("/item/add")
    public String stockAdd(@RequestParam("id")Long id,@RequestParam("num")Long num);

}
